package com.study.easyexcel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.Map;

/**
 * @author tao
 * @create 2021-09-20 9:58
 * @Description
 */
public class ExcelListener extends AnalysisEventListener<UserData> {

    // 一行一行的读取excel内容，从第二行开始读取
    @Override
    public void invoke(UserData data, AnalysisContext context) {
        System.out.println(data);
    }

    // 读取表头
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("表头信息 = " + headMap);
    }

    // 读取之后执行的方法
    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {

    }
}
